<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>{{$users->user_name}}的书包(同城或异地借书，转让图书，交换图书-夜读书网-yedushu.com)</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书中文网">
    <meta name="keywords" content="读书,阅读,小说,文学，同城借书，闲置图书转让">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/yds.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/ucenter.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
</head>
<body>
@include('books.partials.navtop')
@include('books.partials.nav')
<div id="yds_screen">
<div id="yds_content" class="clearfix">
@include('ucenter.partials.umenu')
<div class="spaceList userlist">
    <h1>{{$users->user_name}}的书包<span class="subtitle">共有 {{ $bagscount }} 本图书可转让或出借</span></h1>
    @if(count($bags)!=0)
    @foreach($bags as $bag)
    <div class="liec">
        <table class="ydstable">
        <tbody>        
            <tr>
                <td rowspan="3" class="bookimg"> {{-- rowspan属性:横跨的行数 --}}
                    {{-- $bag->books->book_id (书籍信息book_id) --}}
                    <a href="{{url('shopinfo')}}/{{$bag->id}}" target="_blank" title="{{$bag->books->book_name}}"><img src="{{ asset($bag->books->bimg) }}"></img></a>
                </td>
                <td class="optsbag">
                {{--otype: J借阅，E交换，S转让，B转让或交换或借阅--}}
                @if($bag->otype == 'J')
                <div class=""><span class="namebag">可借阅</span></div>
                @endif
                @if($bag->otype == 'E')
                <div class=""><span class="namebag">交换</span></div>
                @endif
                @if($bag->otype == 'S')
                <div class=""><span class="namebag">转让</span></div>
                @endif
                @if($bag->otype == 'Z')
                <div class=""><span class="namebag">赠送</span></div>
                @endif
                @if($bag->otype == 'B')
                <div class=""><span class="namebag">转让|交换|借阅|赠送</span></div>
                @endif
                </td>
                <td class="optsbag">
                {{--scope:L当地(同城),R当地或异地--}}
                @if($bag->scope == 'L')
                <div class=""><span class="namebag">限同城</span></div>
                <div class=""><span class="jiagebag">({{$users->province}}-{{$users->city}})</span></div>
                @endif
                @if($bag->scope == 'R')
                <div class=""><span class="namebag">当地或异地</span></div>
                @endif
                </td>
                <td class="optsbag">
                {{--condition: 新旧程度--}}
                @if($bag->condition == 10)
                <div class=""><span class="namebag">全新</span></div>
                @endif
                @if($bag->condition == 9)
                <div class=""><span class="namebag">9成新</span></div>
                @endif
                @if($bag->condition == 8)
                <div class=""><span class="namebag">8成新</span></div>
                @endif
                @if($bag->condition == 7)
                <div class=""><span class="namebag">7成新</span></div>
                @endif
                @if($bag->condition == 6)
                <div class=""><span class="namebag">6成新</span></div>
                @endif
                @if($bag->condition == 5)
                <div class=""><span class="namebag">5成新</span></div>
                @endif
                @if($bag->condition == 0)
                <div class=""><span class="namebag">较旧</span></div>
                @endif
                </td>                   
                <td class="">
                    <div class=""><span class="namebag">{{$bag->nowprice}}/{{$bag->books->dingjia}}</span></div>
                </td>
                <td class="">
                    <div class=""><span class="namebag">{{$bag->num}}本</span></div>
                </td>    
                <td class="">
                    <div class=""><span class="jiagebag">{{date('Y-m-d H:i',$bag->add_time)}}</span></div>
                </td>                
            </tr>
            <tr>
                <td colspan="6">
                    @if($bag->beizhu != '')<div class=""><span class="beizhubag">备注：{{$bag->beizhu}}</span></div>@endif
                </td>
            </tr>
            <tr>
                <td colspan="6">
                    @if(Session::get('name')==$users->user_name)
                    <div class="editbag">
                    <span class=""><a href="{{url('bags')}}/{{$bag->id}}/edit">修改</a></span>
                    <span class=""><a href="{{url('bags')}}/{{$bag->id}}/remove" onclick="javascript:return p_del($str='{{$bag->books->book_name}}')">移除</a></span>
                    </div>
                    @endif
                </td>
            </tr>    
        </tbody>
        </table>
    </div> 
    @endforeach       
    {!! $bags->render() !!}
    @else
        <div class="nodata">还没有可转让或出借的书籍。</div>
    @endif
</div>
</div>
</div>
@include('books.partials.footer')

<script language="javascript">
function p_del($str) {var msg= "《" + $str + "》" + "\n\n您真的确定要移除本书吗？\n\n";if (confirm(msg)==true){
return true;}else{return false;}}
</script>

</body>
</html>
